/**************************************TRIM IN JAVASCRIPT STARTS FROM HERE************************************************/
// Removes leading whitespaces
function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) {
	
	return LTrim(RTrim(value));
	
}


function Trim(str)
{  while(str.charAt(0) == (" ") )
  {  str = str.substring(1);
  }
  while(str.charAt(str.length-1) == " " )
  {  str = str.substring(0,str.length-1);
  }
  return str;
}

/************************************************TRIM IN JAVASCRIPT ENDS HERE*******************************************/

/******************************************* FUNCTION FOR EDIT TODAYS PICKS START FROM HERE ***********************************************/

function functionEdit(EditableId,EditableFieldNumber,EditableFieldName,SetEditableId,SetEditableFieldNumber,DisabledField,DisplayTrack,FormId,SubmitForm)
{
	//EditableId = the id which you want to edit.
	//EditableFieldNumber = the fieldnumber will track which field value you want to edit.
	//EditableFieldName = the filedname + fieldnumberwill track which field value you want to edit.
	//SetEditableId = Hidden field name where EditableId need to set.
	//SetEditableFieldNumber  = Hidden field name where EditableFieldNumber need to set.
	//DisabledField = Submit button which need to display none or display on.
	//DisplayTrack = This field track the display of submit button needs to on or off.
	if(document.getElementById(DisplayTrack) != null)
	{
		var DisplaYtracK=document.getElementById(DisplayTrack).value;
		if(document.getElementById(SetEditableId) != null)
		{
			var SetEditableIdVAlue=document.getElementById(SetEditableId).value;
		}
		if(SetEditableIdVAlue == EditableId)
		{
			DisplaYtracK=1;
		}
		else
		{
			DisplaYtracK=0;
		}
		if(DisplaYtracK == 0)
		{
			/*if(document.getElementById(DisabledField) != null)
			{
				document.getElementById(DisabledField).style.display='none';
			}*/
/****************************************************************************************************************************************/			
			if(document.getElementById('Edit_field'+SetEditableIdVAlue) != null)
			{
				document.getElementById('Edit_field'+SetEditableIdVAlue).style.display='';
			}
			if(document.getElementById('Edit'+SetEditableIdVAlue) != null)
			{
				document.getElementById('Edit'+SetEditableIdVAlue).style.display='none';
			}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//alert('Edit_field'+EditableId);
//alert(document.getElementById('Edit_field'+EditableId))
			if(document.getElementById('Edit_field'+EditableId) != null)
			{
				document.getElementById('Edit_field'+EditableId).style.display='none';
			}
			if(document.getElementById('Edit'+EditableId) != null)
			{
				document.getElementById('Edit'+EditableId).style.display='';
			}


/****************************************************************************************************************************************/			
			if(document.getElementById(EditableFieldName+EditableId) != null)
			{
				document.getElementById(EditableFieldName+EditableId).readOnly=false;
				document.getElementById(EditableFieldName+EditableId).select();
				document.getElementById(EditableFieldName+EditableId).focus();
			}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			if(document.getElementById(EditableFieldName+SetEditableIdVAlue) != null)
			{
				document.getElementById(EditableFieldName+SetEditableIdVAlue).readOnly=true;
			}

/****************************************************************************************************************************************/			



			if(document.getElementById(SetEditableId) != null)
			{
				document.getElementById(SetEditableId).value = EditableId;
			}
/****************************************************************************************************************************************/			
			
			if(document.getElementById(SetEditableFieldNumber) != null)
			{
				document.getElementById(SetEditableFieldNumber).value = EditableFieldNumber;
			}
			document.getElementById(DisplayTrack).value=1;
		}
		else
		{
			/*if(document.getElementById(DisabledField) != null)
			{
				document.getElementById(DisabledField).style.display='';
			}*/
			if(document.getElementById(EditableFieldName+EditableId) != null)
			{
				document.getElementById(EditableFieldName+EditableId).readOnly=true;
			}
			
			if(document.getElementById('Edit_field'+EditableId) != null)
			{
				document.getElementById('Edit_field'+EditableId).style.display='';
			}
			if(document.getElementById('Edit'+EditableId) != null)
			{
				document.getElementById('Edit'+EditableId).style.display='none';
			}
	
			if(document.getElementById(SetEditableId) != null)
			{
				document.getElementById(SetEditableId).value = '';
			}
			
			if(document.getElementById(SetEditableFieldNumber) != null)
			{
				document.getElementById(SetEditableFieldNumber).value = '';
			}
			document.getElementById(DisplayTrack).value=0;
		}
	}
	if(document.getElementById(SubmitForm) != null)
	{
		document.getElementById(SubmitForm).value='Edit';
	}
	//picksCheck();
}

/******************************************* FUNCTION FOR EDIT TODAYS PICKS START FROM HERE ***********************************************/


/******************************************* FUNCTION FOR SUBMIT TODAYS PICKS START FROM HERE ***********************************************/

function FunctionSubmit(SubmitField,FormName)
{
	if(document.getElementById(SubmitField) != null)
	{
		document.getElementById(SubmitField).value="Submit";
	}
	picksCheck();
}

/******************************************* FUNCTION FOR SUBMIT TODAYS PICKS START FROM HERE ***********************************************/




function validationSearch()
{
	//alert("sadasdasdas");
	//alert(document.getElementById("SearchBy"));
	if(document.getElementById("SearchBy") != null)
	{
		//alert(document.getElementById("SearchBy").value)
		if(document.getElementById("SearchBy").value == 'weekly' ||  document.getElementById("SearchBy").value == 'monthly' )
		{
			var getSearchBy=document.getElementById("SearchBy").value;
			//alert(document.getElementById(getSearchBy+"_YEaR"))
			if(document.getElementById(getSearchBy+"_YEaR") != null)
			{
				//alert(document.getElementById(getSearchBy+"_YEaR").value);
				if(document.getElementById(getSearchBy+"_YEaR").value == '')
				{
					//alert(document.getElementById(getSearchBy+"_YEaR_Error"))
					if(document.getElementById(getSearchBy+"_YEaR_Error") != null)
					{
						document.getElementById(getSearchBy+"_YEaR_Error").innerHTML='<br /> Select one year first.';
						document.getElementById(getSearchBy+"_YEaR_Error").style.display='';
						return false;
					}
				}
			}
		}
	}
}

function viewDetails(GetId,GetIntermediate)
{
	//alert(GetId+','+GetIntermediate)
	if(document.getElementById(GetIntermediate) != null && document.getElementById(GetIntermediate).value == 0)
	{
		if(document.getElementById(GetId) != null )
		{
			document.getElementById(GetId).style.display='';
		}
		document.getElementById(GetIntermediate).value =1;
	}
	else if(document.getElementById(GetIntermediate) != null && document.getElementById(GetIntermediate).value == 1)
	{
		if(document.getElementById(GetId) != null )
		{
			document.getElementById(GetId).style.display='none';
		}
		document.getElementById(GetIntermediate).value =0;
		
	}
}




function getTotalweeks(ServerScripT,GetYear,DisplayId1,DisplayId2)
{
	sendReqTObackENDTOtotalWeeks(ServerScripT,"YeaR="+GetYear+"&disPlayId1="+DisplayId1+"&disPlayId2="+DisplayId2);
}



function CHANge(arg1,arg2)
{
	//alert(arg1+','+arg2)
	if(document.getElementById(arg1) != null)
	{
		document.getElementById(arg1).value='';
	}
	 
	 
	 //onFocus="if (this.value == this.defaultValue) value = ''" onBlur="if (this.value == '') value = this.defaultValue"
}

function CHANge1(arg1)
{
	//alert(arg1+','+arg2);
	//alert(document.getElementById(arg1))
	if(document.getElementById(arg1) != null)
	{
		//if(arg2 == '')
		document.getElementById(arg1).value='Add new';
		//else
		//document.getElementById(arg1).value=arg2;
	}
	 //onFocus="if (this.value == this.defaultValue) value = ''" onBlur="if (this.value == '') value = this.defaultValue"
}





function changeTypeForSeraching(argument)
{
	var GetVAlue='';
	var GRearguMent=argument.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
	if(document.getElementById("holdVAluE") != null)
	{
		GetVAlue=document.getElementById("holdVAluE").value;
	}
	//alert(GetVAlue);
	//alert(GRearguMent);
	if(document.getElementById(GetVAlue+'_td') != null)
	{
		document.getElementById(GetVAlue+'_td').style.display='none';
	}
	if(document.getElementById(GRearguMent+'_td') != null)
	{
		document.getElementById(GRearguMent+'_td').style.display='';
		document.getElementById("holdVAluE").value=GRearguMent;
	}
	
}






/**************************************************************** CHECK ALL STARTS FROM HERE ***************************************************************/


function checkAll(arg1, arg2,FiEldId ,OtherId)
{
	if(document.getElementById(FiEldId) != null)
	{
		var maxrange= 0;
		if(document.getElementById(arg1) != null)
		{
			maxrange=document.getElementById(arg1).value;
		}
		if(document.getElementById(FiEldId).checked == true)
		{
			var i = 0;
			for(i=arg2;i<=maxrange;i++)
			{
				if(document.getElementById(OtherId+i) != null && document.getElementById(OtherId+i).disabled == false)
				{
					document.getElementById(OtherId+i).checked = true;
					var flag = 1;
				}
			}
			if(flag == 1)
			{
				document.getElementById(FiEldId).disabled = false;
			}
		}
		else
		{
			for(var i=arg2;i<=maxrange;i++)
			{
				
				if(document.getElementById(OtherId+i) != null && document.getElementById(OtherId+i).disabled == false)
				{
					document.getElementById(OtherId+i).checked = false;
				}
			}
		}
	}
}
function check_one(arg1,arg2,arg3,arg4,FiEldId,OtherId)
{

	//arg1=CURRENT CHECKBOX ID;
	//arg2=START INDEX;
	//arg3=END INDEX;
	//arg4=TOTAL NUMBER OF CHECKBOX;
	//var job_Id = '';
	var maxrange= 0;
	var TOtalValue=0;
	if(document.getElementById(arg3) != null)
	{
		maxrange=document.getElementById(arg3).value;
	}
	
	if(document.getElementById(arg4) != null)
	{
		TOtalValue=document.getElementById(arg4).value;
	}
	
	if(document.getElementById(OtherId+arg1) != null)
	{
		document.getElementById(FiEldId).disabled = false;
	}
	var flag = '';
	for(var i=arg2;i<=maxrange;i++)
	{
		if(document.getElementById(OtherId+i) != null)
		{
			if(document.getElementById(OtherId+i).checked == true)
			{
				if(i == arg2)
				{
					flag = 1;
				}
				else
					flag++;
				document.getElementById(FiEldId).checked = false;
				
				//alert(flag);
			}
		}
	}
	//alert(flag+'==='+TOtalValue);
	if(flag == TOtalValue)
	{
		document.getElementById(FiEldId).checked = true;
	}
	else if(flag == '')
	{
		document.getElementById(FiEldId).checked = false;
	}
}


/**************************************************************** CHECK ALL ENDS HERE ***************************************************************/






function mypopup(Pagename)
{
		var screenWidth = screen.width;
	
		var screenHeight = screen.height;
	
		var offset =parseInt(screenWidth - 550)//parseInt((screenWidth*30)/100);
	
		var reqLeft =(offset / 2) //screenWidth -  (offset / 2);//screenWidth - 255;
	
		mywindow = window.open(Pagename,"mywindow","width=550,height=400,status=0,toolbar=0,menubar=0,resizable=0,dependent=0,scrollbars=no");
	
		mywindow.moveTo(reqLeft,150);
}

function picksCheck()
{
	var tempFlaG=0;
	var tempArry='';
	var EditID='';
	var EditField='';
	if(document.getElementById("EditID") != null)
	{
		EditID = document.getElementById("EditID").value;
	}
	if(document.getElementById("EditField") != null)
	{
		EditField = document.getElementById("EditField").value;
	}
	if(EditID == '' && EditField == '' )
	{
		for(var i=1; i<=5 ; i++)
		{
			if(document.getElementById("picksChoice"+i) != null)
			{
				//alert(document.getElementById("picksChoice"+i).value);
				if(document.getElementById("picksChoice"+i).value != '')
				{
					var getValue=document.getElementById("picksChoice"+i).value;
					if(GLOBAL_string.search(getValue) >= 0 || getValue == 'Choose picks' )
					{
						if(tempArry.search(getValue) >= 0 && getValue != 'Choose picks' )
						{
							if(document.getElementById("picksChoiceError"+i) != null)
							{
								document.getElementById("picksChoiceError"+i).innerHTML="<br>Duplicate Entry Cannotbe Possible.";
								document.getElementById("picksChoiceError"+i).style.display='';
								document.getElementById("picksChoice"+i).focus();
								return false;
							}
	
						}
						else if(tempArry.search(getValue) >= 0 && getValue == 'Choose picks' )
						{
							if(document.getElementById("picksChoiceError"+i) != null)
							{
								document.getElementById("picksChoiceError"+i).innerHTML="<br /> Symbol Does Not Valid.";
								document.getElementById("picksChoiceError"+i).style.display='';
								document.getElementById("picksChoice"+i).focus();
								return false;
							}
						}
						else
						{
							if(tempArry == '')
								tempArry=getValue;
							else
								tempArry=tempArry + ','+ getValue;
							if(document.getElementById("picksChoiceError"+i) != null)
							{
								document.getElementById("picksChoiceError"+i).innerHTML="";
								document.getElementById("picksChoiceError"+i).style.display='none';
							}
						}
					}
					else
					{
						if(document.getElementById("picksChoiceError"+i) != null)
						{
							document.getElementById("picksChoiceError"+i).innerHTML="<br /> Symbol Does Not Valid.";
							document.getElementById("picksChoiceError"+i).style.display='';
							document.getElementById("picksChoice"+i).focus();
							return false;
						}
					}
				}
				else
				{
					tempFlaG++;
				}
				if(tempFlaG == 5)
				{
					if(document.getElementById("picksChoiceError1") != null)
					{
						document.getElementById("picksChoiceError1").innerHTML="<br /> You Have To Give Atleast One Symbol.";
						document.getElementById("picksChoiceError1").style.display='';
						document.getElementById("picksChoice1").focus();
						return false;
					}
				}
			}
		}
	}
	else
	{
		for(var i=1;i<=5;i++)
		{
			if(EditField != i)
			{
				if(document.getElementById("picksChoice"+i) != null)
				{
					if(tempArry == '')
						tempArry=document.getElementById("picksChoice"+i).value;
					else
						tempArry=tempArry + ','+ document.getElementById("picksChoice"+i).value;
				}
			}
		}
		
		//alert(tempArry)
		
		if(document.getElementById("picksChoice"+EditField) != null)
		{
			if(document.getElementById("picksChoice"+EditField).value != '')
			{
				var getValue=document.getElementById("picksChoice"+EditField).value;
				//alert(GLOBAL_string+'-----'+getValue);
				if(GLOBAL_string.search(getValue) >= 0 || getValue == 'Choose picks' )
				{
					if(tempArry.search(getValue) >= 0)
					{
						if(document.getElementById("picksChoiceError"+EditField) != null)
						{
							document.getElementById("picksChoiceError"+EditField).innerHTML="<br>Duplicate Entry Cannotbe Possible.";
							document.getElementById("picksChoiceError"+EditField).style.display='';
							document.getElementById("picksChoice"+EditField).focus();
							return false;
						}

					}
					else if(getValue == 'Choose picks' )
					{
						if(document.getElementById("picksChoiceError"+EditField) != null)
						{
							document.getElementById("picksChoiceError"+EditField).innerHTML="<br /> Symbol Does Not Valid.";
							document.getElementById("picksChoiceError"+EditField).style.display='';
							document.getElementById("picksChoice"+EditField).focus();
							return false;
						}
					}
					else
					{
						if(tempArry == '')
							tempArry=getValue;
						else
							tempArry=tempArry + ','+ getValue;
						if(document.getElementById("picksChoiceError"+EditField) != null)
						{
							document.getElementById("picksChoiceError"+EditField).innerHTML="";
							document.getElementById("picksChoiceError"+EditField).style.display='none';
						}
					}
				}
				else
				{
					if(document.getElementById("picksChoiceError"+EditField) != null)
					{
						document.getElementById("picksChoiceError"+EditField).innerHTML="<br /> Symbol Does Not Valid.";
						document.getElementById("picksChoiceError"+EditField).style.display='';
						document.getElementById("picksChoice"+EditField).focus();
						return false;
					}
				}
			}
		}
	}
}


function PreFFCheck(GETid,CheckFOR)
{
	//alert(GETid+'----'+CheckFOR);
	var tempFlaG=0;
	var tempArry='';
	//var NameVAlidation=/[0-9\*\=\_\>\<\:\@\&\%\?\$\-\/\!\^\(\)\{\}\|\~\`\'\"\;\,\.\+\#\\]/;
	var AlertValueVAlidation=/[a-zA-Z\*\=\_\>\<\:\@\&\%\?\$\-\/\!\^\(\)\{\}\|\~\`\'\"\;\,\+\#\\]/;
	if(CheckFOR == 'insert' || CheckFOR == 'Insert' )
	{
		//alert("kjahkjhkjahj");
		for(var i=1; i<=5 ; i++)
		{
			//alert(document.getElementById(GETid+i))
			if(document.getElementById(GETid+i) != null)
			{
				if(document.getElementById(GETid+i).value != '')
				{
					var getValue=document.getElementById(GETid+i).value;
					//alert(getValue)
					if(GLOBAL_string.search(getValue) >= 0 || getValue == 'Add new' )
					{//alert(getValue)
						if(tempArry.search(getValue) >= 0 &&  getValue != 'Add new' )
						{
							//alert(document.getElementById("picksChoiceError"+i));
							//alert(document.getElementById(GETid+"Error_1_"+i));
							if(document.getElementById(GETid+"Error"+i) != null && document.getElementById(GETid+"Error_1_"+i) != null )
							{
								document.getElementById(GETid+"Error_1_"+i).innerHTML="Duplicate Entry Cannotbe Possible.";
								document.getElementById(GETid+"Error"+i).style.display='';
								document.getElementById(GETid+i).focus();
								return false;
							}
	
						}
						var str =Trim(document.getElementById(GETid+i).value);
						if( str=='')
						{
							document.getElementById(GETid+"Error_1_"+i).innerHTML="Spaces Are Not Allowed In Preffered Symbol"+i+" Field.";
							document.getElementById(GETid+"Error"+i).style.display='';
							document.getElementById(GETid+i).ClassName="RedClass";
							document.getElementById(GETid+i).value="";
							document.getElementById(GETid+i).focus();
							return false;
						}
						else
						{
							if(tempArry == '')
								tempArry=getValue;
							else
								tempArry=tempArry + ','+ getValue;
							if(document.getElementById(GETid+"Error"+i) != null && document.getElementById(GETid+"Error_1_"+i) != null )
							{
								document.getElementById(GETid+"Error_1_"+i).innerHTML="";
								document.getElementById(GETid+"Error"+i).style.display='none';
							}
						}
					}
					else
					{
						if(document.getElementById(GETid+"Error"+i) != null)
						{
							document.getElementById(GETid+"Error_1_"+i).innerHTML="Symbol Does Not Valid.";
							document.getElementById(GETid+"Error"+i).style.display='';
							document.getElementById(GETid+i).focus();
							return false;
						}
					}
				}
				else
				{
					tempFlaG++;
				}
				if(tempFlaG == 5)
				{
					if(document.getElementById(GETid+"Error1") != null)
					{
						document.getElementById(GETid+"Error_1_1").innerHTML="You Have To Give Atleast One Symbol.";
						document.getElementById(GETid+"Error1").style.display='';
						document.getElementById(GETid+"1").focus();
						return false;
					}
				}
				//alert("kjashjkash");
			}
			
			if(document.getElementById("MaxLoss"+i) != null)
			{
				if(document.getElementById("MaxLoss"+i).value != '')
				{
					if(document.getElementById("MaxLoss"+i).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById(GETid+"Error"+i) != null)
						{
							document.getElementById(GETid+"Error_1_"+i).innerHTML="Enter Max Loss Field Numeric Value.";
							document.getElementById(GETid+"Error"+i).style.display='';
							document.getElementById("MaxLoss"+i).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("MaxLoss"+i).value);
					if( str=='')
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="Spaces Are Not Allowed In Max Loss Field.";
						document.getElementById(GETid+"Error"+i).style.display='';
						document.getElementById("MaxLoss"+i).ClassName="RedClass";
						document.getElementById("MaxLoss"+i).value="";
						document.getElementById("MaxLoss"+i).focus();
						return false;
					}
					else
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="";
						document.getElementById(GETid+"Error"+i).style.display='none';
						document.getElementById("MaxLoss"+i).ClassName="NormalClass";		
					}
				}
			}
			
			if(document.getElementById("FirstSell"+i) != null)
			{
				if(document.getElementById("FirstSell"+i).value != '')
				{
					if(document.getElementById("FirstSell"+i).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById(GETid+"Error"+i) != null)
						{
							document.getElementById(GETid+"Error_1_"+i).innerHTML="Enter Firs tSell Field Numeric Value.";
							document.getElementById(GETid+"Error"+i).style.display='';
							document.getElementById("FirstSell"+i).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("FirstSell"+i).value);
					if( str=='')
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="Spaces Are Not Allowed In First Sell Field.";
						document.getElementById(GETid+"Error"+i).style.display='';
						document.getElementById("FirstSell"+i).ClassName="RedClass";
						document.getElementById("FirstSell"+i).value="";
						document.getElementById("FirstSell"+i).focus();
						return false;
					}
					else
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="";
						document.getElementById(GETid+"Error"+i).style.display='none';
						document.getElementById("FirstSell"+i).ClassName="NormalClass";		
					}
				}
				
			}
			
			if(document.getElementById("NextLoss"+i) != null)
			{
				if(document.getElementById("NextLoss"+i).value != '')
				{
					if(document.getElementById("NextLoss"+i).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById(GETid+"Error"+i) != null)
						{
							document.getElementById(GETid+"Error_1_"+i).innerHTML="Enter Next Loss Field Numeric Value.";
							document.getElementById(GETid+"Error"+i).style.display='';
							document.getElementById("NextLoss"+i).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("NextLoss"+i).value);
					if( str=='')
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="Spaces Are Not Allowed In Next Loss Field.";
						document.getElementById(GETid+"Error"+i).style.display='';
						document.getElementById("NextLoss"+i).ClassName="RedClass";
						document.getElementById("NextLoss"+i).value="";
						document.getElementById("NextLoss"+i).focus();
						return false;
					}
					else
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="";
						document.getElementById(GETid+"Error"+i).style.display='none';
						document.getElementById("NextLoss"+i).ClassName="NormalClass";		
					}
				}
				
			}
			
			if(document.getElementById("Mustsell"+i) != null)
			{
				if(document.getElementById("Mustsell"+i).value != '')
				{
					if(document.getElementById("Mustsell"+i).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById(GETid+"Error"+i) != null)
						{
							document.getElementById(GETid+"Error_1_"+i).innerHTML="Enter Must sell Field Numeric Value.";
							document.getElementById(GETid+"Error"+i).style.display='';
							document.getElementById("Mustsell"+i).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("Mustsell"+i).value);
					if( str=='')
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="Spaces Are Not Allowed In Must sell Field.";
						document.getElementById(GETid+"Error"+i).style.display='';
						document.getElementById("Mustsell"+i).ClassName="RedClass";
						document.getElementById("Mustsell"+i).value="";
						document.getElementById("Mustsell"+i).focus();
						return false;
					}
					else
					{
						document.getElementById(GETid+"Error_1_"+i).innerHTML="";
						document.getElementById(GETid+"Error"+i).style.display='none';
						document.getElementById("Mustsell"+i).ClassName="NormalClass";		
					}
				}
				
			}
		
			if(document.getElementById("Featured"+i) != null)
			{
				if(document.getElementById("Featured"+i).disabled == false && document.getElementById("Featured"+i).checked == true )
				{
					if(document.getElementById(GETid+i) != null)
					document.getElementById("FeaTUREd").value = document.getElementById(GETid+i).value;
					//return false;
					//alert("asASasA");
				}
				else if(document.getElementById("Featured"+i).disabled == false )
				{
					document.getElementById("FeaTUREd").value = '';
					//return false;
				}
			}
		}
	}
	else if(CheckFOR == 'update' || CheckFOR == 'Update' )
	{
		//alert("kjahkjhkjahj");
		//for(var i=1; i<=5 ; i++)
		//{
			if(document.getElementById("MaxLoss"+GETid) != null)
			{
				if(document.getElementById("MaxLoss"+GETid).value != '')
				{
					if(document.getElementById("MaxLoss"+GETid).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById("PreFFChoiceError"+GETid) != null)
						{
							document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Enter Max Loss Field Numeric Value.";
							document.getElementById("PreFFChoiceError"+GETid).style.display='';
							document.getElementById("MaxLoss"+GETid).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("MaxLoss"+GETid).value);
					if( str=='')
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Spaces Are Not Allowed In Max Loss Field.";
						document.getElementById("PreFFChoiceError"+GETid).style.display='';
						document.getElementById("MaxLoss"+GETid).ClassName="RedClass";
						document.getElementById("MaxLoss"+GETid).value="";
						document.getElementById("MaxLoss"+GETid).focus();
						return false;
					}
					else
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="";
						document.getElementById("PreFFChoiceError"+GETid).style.display='none';
						document.getElementById("MaxLoss"+GETid).ClassName="NormalClass";		
					}
				}
			}
			
			if(document.getElementById("FirstSell"+GETid) != null)
			{
				if(document.getElementById("FirstSell"+GETid).value != '')
				{
					if(document.getElementById("FirstSell"+GETid).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById("PreFFChoiceError"+GETid) != null)
						{
							document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Enter Firs tSell Field Numeric Value.";
							document.getElementById("PreFFChoiceError"+GETid).style.display='';
							document.getElementById("FirstSell"+GETid).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("FirstSell"+GETid).value);
					if( str=='')
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Spaces Are Not Allowed In First Sell Field.";
						document.getElementById("PreFFChoiceError"+GETid).style.display='';
						document.getElementById("FirstSell"+GETid).ClassName="RedClass";
						document.getElementById("FirstSell"+GETid).value="";
						document.getElementById("FirstSell"+GETid).focus();
						return false;
					}
					else
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="";
						document.getElementById("PreFFChoiceError"+GETid).style.display='none';
						document.getElementById("FirstSell"+GETid).ClassName="NormalClass";		
					}
				}
				
			}
			
			if(document.getElementById("NextLoss"+GETid) != null)
			{
				if(document.getElementById("NextLoss"+GETid).value != '')
				{
					if(document.getElementById("NextLoss"+GETid).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById("PreFFChoiceError"+GETid) != null)
						{
							document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Enter Next Loss Field Numeric Value.";
							document.getElementById("PreFFChoiceError"+GETid).style.display='';
							document.getElementById("NextLoss"+GETid).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("NextLoss"+GETid).value);
					if( str=='')
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Spaces Are Not Allowed In Next Loss Field.";
						document.getElementById("PreFFChoiceError"+GETid).style.display='';
						document.getElementById("NextLoss"+GETid).ClassName="RedClass";
						document.getElementById("NextLoss"+GETid).value="";
						document.getElementById("NextLoss"+GETid).focus();
						return false;
					}
					else
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="";
						document.getElementById("PreFFChoiceError"+GETid).style.display='none';
						document.getElementById("NextLoss"+GETid).ClassName="NormalClass";		
					}
				}
				
			}
			
			if(document.getElementById("Mustsell"+GETid) != null)
			{
				if(document.getElementById("Mustsell"+GETid).value != '')

				{
					if(document.getElementById("Mustsell"+GETid).value.search(AlertValueVAlidation) >= 0)
					{						
						if(document.getElementById("PreFFChoiceError"+GETid) != null)
						{
							document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Enter Must sell Field Numeric Value.";
							document.getElementById("PreFFChoiceError"+GETid).style.display='';
							document.getElementById("Mustsell"+GETid).focus();
							return false;
						}
					}
					var str =Trim(document.getElementById("Mustsell"+GETid).value);
					if( str=='')
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="Spaces Are Not Allowed In Must sell Field.";
						document.getElementById("PreFFChoiceError"+GETid).style.display='';
						document.getElementById("Mustsell"+GETid).ClassName="RedClass";
						document.getElementById("Mustsell"+GETid).value="";
						document.getElementById("Mustsell"+GETid).focus();
						return false;
					}
					else
					{
						document.getElementById("PreFFChoiceError_1_"+GETid).innerHTML="";
						document.getElementById("PreFFChoiceError"+GETid).style.display='none';
						document.getElementById("Mustsell"+GETid).ClassName="NormalClass";		
					}
				}
				
			}
		//}
	}
	
}


function FEatuREdCHECK(GETnamE,GetCurrentId,Total,SymBolfieLD)
{
	if(document.getElementById(GETnamE+GetCurrentId) != null)
	{
		if(document.getElementById(GETnamE+GetCurrentId).checked == true)
		{
			for(var i=1;i<=Total;i++)
			{
				if(i != GetCurrentId)
				{
					if(document.getElementById(GETnamE+i) != null)
					{
						document.getElementById(GETnamE+i).disabled=true;
					}
				}
			}
			if(document.getElementById("FeaTUREd") != null)
			{
				if(document.getElementById(SymBolfieLD+GetCurrentId) != null)
					document.getElementById("FeaTUREd").value = document.getElementById(SymBolfieLD+GetCurrentId).value;
			}
		}
		else
		{
			for(var i=1;i<=Total;i++)
			{
				if(i != GetCurrentId)
				{
					if(document.getElementById(GETnamE+i) != null)
					{
						document.getElementById(GETnamE+i).disabled=false;
					}
				}
			}
			if(document.getElementById("FeaTUREd") != null)
			{
				document.getElementById("FeaTUREd").value ='';
			}
		}
	}
}



function CHECKemail(GetId,Getcounter)
{
	var EmailVALIdation=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(document.getElementById(GetId+Getcounter) != null)
	{
		if(document.getElementById(GetId+Getcounter).value != '')
		{
			if(!EmailVALIdation.test(document.getElementById(GetId+Getcounter).value))
			{
				document.getElementById(GetId+"Error"+Getcounter).innerHTML="<br>Invalid Email Address.";
				document.getElementById(GetId+"Error"+Getcounter).style.display='';
				document.getElementById(GetId+Getcounter).ClassName="RedClass";
				document.getElementById(GetId+Getcounter).focus();
				return false;
			}
			/*var str =Trim(document.getElementById(GetId).value);
			if( str=='')
			{
				document.getElementById(GetId+"Error"+Getcounter).innerHTML="<br>Please Dont Give Space In Email Field.";
				document.getElementById(GetId+"Error"+Getcounter).style.display='';
				document.getElementById(GetId+Getcounter).ClassName="RedClass";
				document.getElementById(GetId+Getcounter).value="";
				document.getElementById(GetId+Getcounter).focus();
				return false;
			}*/
			else
			{
				document.getElementById(GetId+"Error"+Getcounter).innerHTML="";
				document.getElementById(GetId+"Error"+Getcounter).style.display='none';
				document.getElementById(GetId+Getcounter).ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById(GetId+"Error"+Getcounter) != null)
			{
				document.getElementById(GetId+"Error"+Getcounter).innerHTML="<br>Please Type Your Email.";
				document.getElementById(GetId+"Error"+Getcounter).style.display='';
				document.getElementById(GetId+Getcounter).ClassName="RedClass";
				document.getElementById(GetId+Getcounter).focus();
				return false;
			}
		}
	}

}
function ViewDetails(GEtID)
{
	var InterMediateValue='';
	if(document.getElementById('INTERmediaTDEvalUE') != null)
	{
		InterMediateValue= document.getElementById('INTERmediaTDEvalUE').value;
	}
	if(InterMediateValue != GEtID)
	{
		if(document.getElementById('VIEw'+GEtID) != null)
		{
			if(document.getElementById('VIEw'+GEtID).style.display != '')
			{
				document.getElementById('VIEw'+GEtID).style.display ='';
			}
			else
			{
				document.getElementById('VIEw'+GEtID).style.display ='none';
			}
			if(document.getElementById('VIEw'+InterMediateValue) != null)
			{
				document.getElementById('VIEw'+InterMediateValue).style.display ='none';
			}
			document.getElementById('INTERmediaTDEvalUE').value = GEtID;
		}
	}
	else
	{
		if(document.getElementById('VIEw'+GEtID) != null)
		{
			if(document.getElementById('VIEw'+GEtID).style.display != '')
			{
				document.getElementById('VIEw'+GEtID).style.display ='';
			}
			else
			{
				document.getElementById('VIEw'+GEtID).style.display ='none';
			}
			document.getElementById('INTERmediaTDEvalUE').value = GEtID;
		}		
	}
}


function SetPublishNAme()
{
	if(document.getElementById("PUblishNameDrop") != null)
	{
		if(document.getElementById("PUblishNameDrop").value != '')
		{
			if(document.getElementById("PUblishNameDrop").value != 0 )
			{				
				if(document.getElementById("PUblishName") != null )
				{
					document.getElementById("PUblishName").value=document.getElementById("PUblishNameDrop").value;
					document.getElementById("PUblishNameError").innerHTML="";
					document.getElementById("PUblishNameError").style.display='none';
					document.getElementById("PUblishNameDrop").ClassName="NormalClass";	

				}
			}
			else
			{
				if(document.getElementById("PUblishNameText") != null )
				{
					if(document.getElementById("PUblishName").value != '' )
					{
						document.getElementById("PUblishName").value=document.getElementById("PUblishNameText").value;
						document.getElementById("PUblishNameError").innerHTML="";
						document.getElementById("PUblishNameError").style.display='none';
						document.getElementById("PUblishNameDrop").ClassName="NormalClass";	
					}
					else
					{
						document.getElementById("PUblishNameError").innerHTML="<br /> Publish Name CanNot Be Blank";
						document.getElementById("PUblishNameError").style.display='';
						document.getElementById("PUblishNameDrop").ClassName="RedClass";
						return false;
					}
				}
			}
		}
		else
		{
			document.getElementById("PUblishNameError").innerHTML="<br /> Publish Name CanNot Be Blank";
			document.getElementById("PUblishNameError").style.display='';
			document.getElementById("PUblishNameDrop").ClassName="RedClass";
			return false;
		}
	}
}


function changecolorMenue(GetId)
{
	if(document.getElementById(GetId) != null)
	{
		document.getElementById(GetId).className='ButtonBgWithContent-Rol';
	}
	//alert(GetId)
	//alert(document.getElementById(GetId+'1'))
	if(document.getElementById(GetId+'1') != null)
	{
		//alert(document.getElementById(GetId+'1').SRC)
		document.getElementById(GetId+'1').src='images/TodaysButtonLeft.jpg';
	}
	if(document.getElementById(GetId+'2') != null)
	{
		document.getElementById(GetId+'2').src='images/TodaysButtonRight.jpg';
	}
}

function changecolorMenue1(GetId)
{
	if(document.getElementById(GetId) != null)
	{
		document.getElementById(GetId).className='ButtonBgWithContent-NoSelect';
	}
	if(document.getElementById(GetId+'1') != null)
	{
		document.getElementById(GetId+'1').src='images/TodaysButtonLeftNotSelecte.jpg';
	}
	if(document.getElementById(GetId+'2') != null)
	{
		document.getElementById(GetId+'2').src='images/TodaysButtonRightNotSelecte.jpg';
	}
}

function changecolorMenueTExt(GetId)
{
	if(document.getElementById(GetId) != null)
	{
		document.getElementById(GetId).className='ButtonBgWithContent-Rol';
	}
}

function changecolorMenueTExt1(GetId)
{
	if(document.getElementById(GetId) != null)
	{
		document.getElementById(GetId).className='ButtonBgWithContent-Nor';
	}
}



function selectMONTHorDAY(SelectedValue)
{
	if(SelectedValue == 'Month')
	{
		if(document.getElementById(SelectedValue) != null && document.getElementById(SelectedValue+'SELECT') != null )
		{
			document.getElementById(SelectedValue+'SELECT').style.display='';
			document.getElementById(SelectedValue).disabled=false;
		}
		
		if(document.getElementById('Day') != null && document.getElementById('DaySELECT') != null )
		{
			document.getElementById('DaySELECT').style.display='none';
			document.getElementById('Day').disabled=true;
		}
	}
	else
	{
		if(document.getElementById(SelectedValue) != null && document.getElementById(SelectedValue+'SELECT') != null )
		{
			document.getElementById(SelectedValue+'SELECT').style.display='';
			document.getElementById(SelectedValue).disabled=false;
		}
		
		if(document.getElementById('Month') != null && document.getElementById('MonthSELECT') != null )
		{
			document.getElementById('MonthSELECT').style.display='none';
			document.getElementById('Month').disabled=true;
		}
	}
}

function DisplayPlan(DisplayField,NOTDisplayField)
{
	/*alert("asdasdas----"+DisplayField+'----'+DisabledField);
	alert(document.getElementById(DisplayField));*/
	if(document.getElementById(DisplayField) != null)
	{
		document.getElementById(DisplayField).style.display='';
	}
	/*if(document.getElementById(ENabledField) != null)
	{
		document.getElementById(ENabledField).disabled=false;
	}*/
	if(document.getElementById(NOTDisplayField) != null)
	{
		document.getElementById(NOTDisplayField).style.display='none';
	}
}

function NOTDisplayPlan(DisplayField,NOTDisplayField)
{
	/*alert("asdasdas----"+DisplayField+'----'+DisabledField);
	alert(document.getElementById(DisplayField));*/
	if(document.getElementById(DisplayField) != null)
	{
		document.getElementById(DisplayField).style.display='';
	}
	/*if(document.getElementById(DisabledField) != null)
	{
		document.getElementById(DisabledField).disabled=true;
	}*/
	if(document.getElementById(NOTDisplayField) != null)
	{
		document.getElementById(NOTDisplayField).style.display='none';
	}
}

function DontDisplayPlan(DisplayField,DisabledField)
{
	if(document.getElementById(DisplayField) != null)
	{
		document.getElementById(DisplayField).style.display='none';
	}
	if(document.getElementById(DisabledField) != null)
	{
		document.getElementById(DisabledField).disabled=true;
	}
}
function DontDisplayPlanWithSubmit(DisplayField,DisabledField,FormName,ActionPage)
{
	/*if(document.getElementById(DisplayField) != null)
	{
		document.getElementById(DisplayField).style.display='none';
	}
	if(document.getElementById(DisabledField) != null)
	{
		document.getElementById(DisabledField).disabled=true;
	}*/
	if(document.getElementById(FormName) != null)
	{
		//alert(ActionPage);
		var RetuRnVALue=formvalidation();
		//alert('dsfdsf===='+RetuRnVALue);
		if(RetuRnVALue)
		{
			document.getElementById(FormName).action=ActionPage+'.php';
			document.getElementById(FormName).submit();
		}
		//document.getElementById(FormName).submit();
	}
}

function RETUrnSETday(arg1,arg2,arg3,arg4)
{
	// arg1 = Month Dropdown Id
	// arg2 = State Dropdown Id
	// arg3 = State Td Id
	// arg4 = Year Value
		
		var VAlueTEmp=document.getElementById(arg1).value;//arg1;
		//alert(VAlueTEmp);
		if(VAlueTEmp == 1 || VAlueTEmp == 3 || VAlueTEmp == 5 || VAlueTEmp == 7 || VAlueTEmp == 8 || VAlueTEmp == 10 || VAlueTEmp == 12)
		{
			if(document.getElementById(arg3) != null)
			{
				var OPTIonVAlue='';
				for(var i=1;i<=31;i++)
				{
					OPTIonVAlue+='<option value="'+i+'">'+i+'</option>';
				}
				document.getElementById(arg3).innerHTML='<select name="'+arg2+'" id="'+arg2+'" autocomplete="off">'+OPTIonVAlue+'</select>';
			}
		}
		else if(VAlueTEmp == 2 )
		{
			if(document.getElementById(arg4) != null)
			{
				var VAlueTEmpYEAR=document.getElementById(arg4).value;
				//alert("year=="+VAlueTEmpYEAR);
				if(parseInt(VAlueTEmpYEAR % 400) == 0)
				{
					var OPTIonVAlue='';
					for(var i=1;i<=29;i++)
					{
						OPTIonVAlue+='<option value="'+i+'">'+i+'</option>';
					}
					if(document.getElementById(arg3) != null)
					{
						document.getElementById(arg3).innerHTML='<select name="'+arg2+'" id="'+arg2+'" autocomplete="off">'+OPTIonVAlue+'</select>';
					}
				}
				else
				{
					var OPTIonVAlue='';
					for(var i=1;i<=28;i++)
					{
						OPTIonVAlue+='<option value="'+i+'">'+i+'</option>';
					}
					if(document.getElementById(arg3) != null)
					{
						document.getElementById(arg3).innerHTML='<select name="'+arg2+'" id="'+arg2+'" autocomplete="off">'+OPTIonVAlue+'</select>';
					}

				}
			}
		}
		else
		{
			if(document.getElementById(arg3) != null)
			{
				var OPTIonVAlue='';
				for(var i=1;i<=30;i++)
				{
					OPTIonVAlue+='<option value="'+i+'">'+i+'</option>';
				}
				if(document.getElementById(arg3) != null)
				{
					document.getElementById(arg3).innerHTML='<select name="'+arg2+'" id="'+arg2+'" autocomplete="off">'+OPTIonVAlue+'</select>';
				}
			}
			
		}
	//}
	
}

function ChangeCountryStateCity(ServerScripT,CountryId,StateId,CityId,Type)
{
	if(Type == "COUNTRY")
	{
		if(document.getElementById(CountryId) != null)
		{
			var CountrYId=document.getElementById(CountryId).value;
			//alert(ServerScripT+"--CountryId="+CountrYId +'--StateId='+StateId+'--CityId='+CityId+'--Type='+Type);
			//alert(CountrYId)
			if(CountrYId != 0)
			{
				document.getElementById(CountryId).style.display='';
				/*document.getElementById(CountryId+'1').style.display='';
				document.getElementById(CountryId+'1').disabled=true;*/
				if(document.getElementById(CountryId+'1') != null)
				{
					document.getElementById(CountryId+'1').style.display='none';
				}
				if(document.getElementById(CountryId+'1') != null)
				{
					document.getElementById(CountryId+'1').disabled=true;
				}
				if(document.getElementById(Type+'1') != null)
				{
					document.getElementById(Type+'1').style.display='none';
				}
				
				/********************************* FOR STATE **************************************/ 
				if(document.getElementById('StaTeSELECT1') != null && document.getElementById('STATE1') != null)
				{
					document.getElementById('StaTeSELECT1').disabled=true;
					document.getElementById('STATE1').style.display='none';
				}
				
				if(document.getElementById('StaTeSELECT') != null && document.getElementById('STATE') != null)
				{
					document.getElementById('StaTeSELECT').disabled=false;
					document.getElementById('STATE').style.display='';
				}
				/********************************* FOR CITY **************************************/ 
				if(document.getElementById('CiTySelect1') != null && document.getElementById('CITY1') != null)
				{
					document.getElementById('CiTySelect1').disabled=true;
					document.getElementById('CITY1').style.display='none';
				}
				
				if(document.getElementById('CiTySelect') != null && document.getElementById('CITY') != null)
				{
					document.getElementById('CiTySelect').disabled=false;
					document.getElementById('CITY').style.display='';
				}
				sendReqTObackENDTOexeCUTE(ServerScripT,"CountryId="+CountrYId);
			
			}
			else
			{
				//alert("asdasdasdas");
				/*alert(CountryId);
				alert(document.getElementById(CountryId));
				alert(document.getElementById(CountryId+'1'));
				alert(document.getElementById(Type+'1'));*/
				if(document.getElementById(CountryId+'1') != null)
				{
					document.getElementById(CountryId+'1').style.display='';
				}
				if(document.getElementById(CountryId+'1') != null)
				{
					document.getElementById(CountryId+'1').disabled=false;
				}
				if(document.getElementById(Type+'1') != null)
				{
					document.getElementById(Type+'1').style.display='';
				}
				/********************************* FOR STATE **************************************/
				//alert(document.getElementById('StaTeSELECT1'));
				//alert(document.getElementById('STATE1'));
				if(document.getElementById('StaTeSELECT1') != null && document.getElementById('STATE1') != null)
				{
					document.getElementById('StaTeSELECT1').disabled=false;
					document.getElementById('STATE1').style.display='';
				}
				
				if(document.getElementById('StaTeSELECT') != null && document.getElementById('STATE') != null)
				{
					document.getElementById('StaTeSELECT').disabled=true;
					document.getElementById('STATE').style.display='none';
				}
				/********************************* FOR CITY **************************************/ 
				if(document.getElementById('CiTySelect1') != null && document.getElementById('CITY1') != null)
				{
					document.getElementById('CiTySelect1').disabled=false;
					document.getElementById('CITY1').style.display='';
				}
				
				if(document.getElementById('CiTySelect') != null && document.getElementById('CITY') != null)
				{
					document.getElementById('CiTySelect').disabled=true;
					document.getElementById('CITY').style.display='none';
				}
			}
		}
	}
	if(Type == "STATE")
	{
		//alert("sadlkaskldjask")
		if(document.getElementById(CountryId) != null && document.getElementById(StateId) != null )
		{
			var CountrYId=document.getElementById(CountryId).value;
			var StatEId=document.getElementById(StateId).value;
			//alert("CountryId="+CountrYId+"&StateId="+StatEId)
			sendReqTObackENDTOexeCUTE(ServerScripT,"CountryId="+CountrYId+"&StateId="+StatEId);
		}
	}
	if(Type == "CITY")
	{
		if(document.getElementById(CountryId) != null && document.getElementById(StateId) != null && document.getElementById(CityId) != null )
		{
			var CountrYId=document.getElementById(CountryId).value;
			var StatEId=document.getElementById(StateId).value;
			var CitYId=document.getElementById(CityId).value;
			sendReqTObackENDTOexeCUTE(ServerScripT,"CountryId="+CountrYId+"&StateId="+StatEId+"&CityId="+CitYId);
		}
	}
	
}

function CHECKpickS(ServerScripT,SELEctVALue,IdFORinnerhTml,HiDDENfiELdVAlue)
{	
	var InnerHTMlId=IdFORinnerhTml;
	var HOLDvaLUE=' WHERE 1';
	if(IdFORinnerhTml == 1)
	{
		if(document.getElementById("select1") != null && document.getElementById("select1").value == '')
		{
			for(var i=2; i<=5; i++)
			{
				if(document.getElementById("select"+i) != null)
				{
					document.getElementById("select"+i+'.'+i).innerHTML='<select name="select'+i+'" id="select'+i+'" onchange="CHECKpickS(\'PicksBackend.php\',this.value,'+i+');"><option value="" selected="selected">---Select One---</option></select>';
					document.getElementById("select"+i).disabled = true;
				}
			}
			return false;
		}
		else
		{
			HOLDvaLUE+=' AND `companyId`<>'+document.getElementById('select1').value;
			for(var i=3; i<=5; i++)
			{
				if(document.getElementById("select"+i) != null)
				{
					document.getElementById("select"+i+'.'+i).innerHTML='<select name="select'+i+'" id="select'+i+'" onchange="CHECKpickS(\'PicksBackend.php\',this.value,'+i+');"><option value="" selected="selected">---Select One---</option></select>';
					document.getElementById("select"+i).disabled = true;
				}
			}
		}
	}
	else
	{
		for(var i=1; i<=5; i++)
		{
			if(i <= IdFORinnerhTml)
			{
				if(document.getElementById("select"+i) != null && document.getElementById("select"+i).disabled == false)
				{
					//alert("select"+i);alert(document.getElementById("select"+i).value)
					if( document.getElementById("select"+i).value != '')
					{
						HOLDvaLUE+=' AND `companyId`<>'+document.getElementById('select'+i).value;
					}
					else
					{
						IdFORinnerhTml=parseInt(i-1);
						var DISABLEDid=parseInt(i+1);
						document.getElementById("select"+i+'.'+i).innerHTML='<select name="select'+i+'" id="select'+i+'" onchange="CHECKpickS(\'PicksBackend.php\',this.value,'+i+');"><option value="" selected="selected">---Select One---</option></select>';
						document.getElementById("select"+DISABLEDid).disabled = true;
					}
				}
			}
			else
			{
				if(document.getElementById("select"+i) != null)
				{
					document.getElementById("select"+i+'.'+i).innerHTML='<select name="select'+i+'" id="select'+i+'" onchange="CHECKpickS(\'PicksBackend.php\',this.value,'+i+');"><option value="" selected="selected">---Select One---</option></select>';
					document.getElementById("select"+i).disabled = true;
				}			
			}
		}
	}
	

	//alert(HOLDvaLUE)
	//sendReqTObackENDTOexeCUTEPICKer(ServerScripT,"QUERYvalUE="+QUERyvaLUe+"&QUERYvalUE1="+TEMQUeryVAlue+"&INNERHTmalID="+IdFORinnerhTml);
	//alert(ServerScripT+','+"QUERYvalUE="+QUERyvaLUe+"&INNERHTmalID="+IdFORinnerhTml);
	sendReqTObackENDTOexeCUTEPICKer(ServerScripT,"QUERYvalUE="+HOLDvaLUE+"&INNERHTmalID="+IdFORinnerhTml);
}



/*************************************** VALIDATION STARTS FROM HERE **********************************************/

function formvalidation()
{
	//alert("sadhashdlaskdlask");
	var NameVAlidation=/[0-9\*\=\_\>\<\:\@\&\%\?\$\-\/\!\^\(\)\{\}\|\~\`\'\"\;\,\.\+\#\\]/;
	//var USERNameVAlidation=/[\*\=\_\>\<\:\@\&\%\?\$\-\/\!\^\(\)\{\}\|\~\`\'\"\;\,\.\+\#\\]/;
	var EmailVALIdation=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	var PhonEVAlidation=/[a-zA-Z\*\=\_\>\<\:\@\&\%\?\$\/\!\^\(\)\{\}\|\~\`\'\"\;\,\.\\]/;
	var AddressvalIDAtiON=/[\*\=\_\>\<\:\@\&\%\?\$\!\^\(\)\{\}\|\~\`\"\;\.\+\#\\]/;
	var ZIpVAlidation=/[\*\=\_\>\<\:\@\&\%\?\$\-\/\!\^\(\)\{\}\|\~\`\'\"\;\,\.\+\#\\]/;
	var RETURnvalUE=false;

	if(document.getElementById("UserName") != null)
	{
		
		if(document.getElementById("UserName").value != '')
		{
			if(document.getElementById("UserName").value.length < 6)
			{
				document.getElementById("UserNameError").innerHTML="<br>Please Type Your User Name Grater Then 6 charecters.";
				document.getElementById("UserNameError").style.display='';
				document.getElementById("UserName").ClassName="RedClass";
				document.getElementById("UserName").focus();
				return false;
			}
			var str =Trim(document.getElementById("UserName").value);
			if( str=='')
			{
				document.getElementById("UserNameError").innerHTML="<br>Please Dont Give Space In User Name Field.";
				document.getElementById("UserNameError").style.display='';
				document.getElementById("UserName").ClassName="RedClass";
				document.getElementById("UserName").value="";
				document.getElementById("UserName").focus();
				return false;
			}
			else
			{
				document.getElementById("UserNameError").innerHTML="";
				document.getElementById("UserNameError").style.display='none';
				document.getElementById("UserName").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("UserNameError") != null)
			{
				document.getElementById("UserNameError").innerHTML="<br>Please Type Your User Name.";
				document.getElementById("UserNameError").style.display='';
				document.getElementById("UserName").ClassName="RedClass";
				document.getElementById("UserName").focus();
				return false;
			}
		}
	}

	if(document.getElementById("PassWord") != null)
	{
		if(document.getElementById("PassWord").value != '')
		{
			if(document.getElementById("PassWord").value.length < 6)
			{
				document.getElementById("PassWordError").innerHTML="<br>Please Type Your Password Grater Then 6 charecters.";
				document.getElementById("PassWordError").style.display='';
				document.getElementById("PassWord").ClassName="RedClass";
				document.getElementById("PassWord").focus();
				return false;
			}
			var str =Trim(document.getElementById("PassWord").value);
			if( str=='')
			{
				document.getElementById("PassWordError").innerHTML="<br>Please Dont Give Space In Password Field.";
				document.getElementById("PassWordError").style.display='';
				document.getElementById("PassWord").ClassName="RedClass";
				document.getElementById("PassWord").value="";
				document.getElementById("PassWord").focus();
				return false;
			}
			else
			{
				document.getElementById("PassWordError").innerHTML="";
				document.getElementById("PassWordError").style.display='none';
				document.getElementById("PassWord").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("PassWordError") != null)
			{
				document.getElementById("PassWordError").innerHTML="<br>Please Type Your Password.";
				document.getElementById("PassWordError").style.display='';
				document.getElementById("PassWord").ClassName="RedClass";
				document.getElementById("PassWord").focus();
				return false;
			}
		}
	}

	if(document.getElementById("RPassWord") != null)
	{
		if(document.getElementById("RPassWord").value != '')
		{
			if(document.getElementById("RPassWord").value != document.getElementById("PassWord").value )
			{
				document.getElementById("RPassWordError").innerHTML="<br>Password Mismatch.";
				document.getElementById("RPassWordError").style.display='';
				document.getElementById("RPassWord").ClassName="RedClass";
				document.getElementById("RPassWord").focus();
				return false;
			}
			var str =Trim(document.getElementById("RPassWord").value);
			if( str=='')
			{
				document.getElementById("RPassWordError").innerHTML="<br>Please Dont Give Space In Retype Password Field.";
				document.getElementById("RPassWordError").style.display='';
				document.getElementById("RPassWord").ClassName="RedClass";
				document.getElementById("RPassWord").value="";
				document.getElementById("RPassWord").focus();
				return false;
			}
			else
			{
				document.getElementById("RPassWordError").innerHTML="";
				document.getElementById("RPassWordError").style.display='none';
				document.getElementById("RPassWord").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("RPassWordError") != null)
			{
				document.getElementById("RPassWordError").innerHTML="<br>Please Retype Your Password.";
				document.getElementById("RPassWordError").style.display='';
				document.getElementById("RPassWord").ClassName="RedClass";
				document.getElementById("RPassWord").focus();
				return false;
			}
		}
	}

	if(document.getElementById("FirstName") != null)
	{
		if(document.getElementById("FirstName").value != '')
		{
			//alert(document.getElementById("FirstName").value)
			//alert(document.getElementById("FirstName").value.search(NameVAlidation))
			if(document.getElementById("FirstName").value.search(NameVAlidation) >= 0 )
			{
				document.getElementById("FirstNameError").innerHTML="<br>Your First Name Should Be Only Charecters.";
				document.getElementById("FirstNameError").style.display='';
				document.getElementById("FirstName").ClassName="RedClass";
				document.getElementById("FirstName").focus();
				return false;
			}
			var str =Trim(document.getElementById("FirstName").value);
			if( str=='')
			{
				document.getElementById("FirstNameError").innerHTML="<br>Please Dont Give Space In First Name Field.";
				document.getElementById("FirstNameError").style.display='';
				document.getElementById("FirstName").ClassName="RedClass";
				document.getElementById("FirstName").value="";
				document.getElementById("FirstName").focus();
				return false;
			}
			else
			{
				document.getElementById("FirstNameError").innerHTML="";
				document.getElementById("FirstNameError").style.display='none';
				document.getElementById("FirstName").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("FirstNameError") != null)
			{
				document.getElementById("FirstNameError").innerHTML="<br>Please Type Your First Name.";
				document.getElementById("FirstNameError").style.display='';
				document.getElementById("FirstName").ClassName="RedClass";
				document.getElementById("FirstName").focus();
				return false;
			}
		}
	}



	if(document.getElementById("LastName") != null)
	{
		if(document.getElementById("LastName").value != '')
		{
			if(document.getElementById("LastName").value.search(NameVAlidation) >= 0)
			{
				document.getElementById("LastNameError").innerHTML="<br>Your Last Name Should Be Only Charecters.";
				document.getElementById("LastNameError").style.display='';
				document.getElementById("LastName").ClassName="RedClass";
				document.getElementById("LastName").focus();
				return false;
			}
			var str =Trim(document.getElementById("LastName").value);
			if( str=='')
			{
				document.getElementById("LastNameError").innerHTML="<br>Please Dont Give Space In Last Name Field.";
				document.getElementById("LastNameError").style.display='';
				document.getElementById("LastName").ClassName="RedClass";
				document.getElementById("LastName").value="";
				document.getElementById("LastName").focus();
				return false;
			}
			else
			{
				document.getElementById("LastNameError").innerHTML="";
				document.getElementById("LastNameError").style.display='none';
				document.getElementById("LastName").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("LastNameError") != null)
			{
				document.getElementById("LastNameError").innerHTML="<br>Please Type Your Last Name.";
				document.getElementById("LastNameError").style.display='';
				document.getElementById("LastName").ClassName="RedClass";
				document.getElementById("LastName").focus();
				return false;
			}
		}
	}



	if(document.getElementById("EmaiL") != null)
	{
		if(document.getElementById("EmaiL").value != '')
		{
			if(!EmailVALIdation.test(document.getElementById("EmaiL").value))
			{
				document.getElementById("EmaiLError").innerHTML="<br>Invalid Email Address.";
				document.getElementById("EmaiLError").style.display='';
				document.getElementById("EmaiL").ClassName="RedClass";
				document.getElementById("EmaiL").focus();
				return false;
			}
			var str =Trim(document.getElementById("EmaiL").value);
			if( str=='')
			{
				document.getElementById("EmaiLError").innerHTML="<br>Please Dont Give Space In Email Field.";
				document.getElementById("EmaiLError").style.display='';
				document.getElementById("EmaiL").ClassName="RedClass";
				document.getElementById("EmaiL").value="";
				document.getElementById("EmaiL").focus();
				return false;
			}
			else
			{
				document.getElementById("EmaiLError").innerHTML="";
				document.getElementById("EmaiLError").style.display='none';
				document.getElementById("EmaiL").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("EmaiLError") != null)
			{
				document.getElementById("EmaiLError").innerHTML="<br>Please Type Your Email.";
				document.getElementById("EmaiLError").style.display='';
				document.getElementById("EmaiL").ClassName="RedClass";
				document.getElementById("EmaiL").focus();
				return false;
			}
		}
	}



	if(document.getElementById("ADD1") != null)
	{
		if(document.getElementById("ADD1").value != '')
		{
			if(document.getElementById("ADD1").value.search(AddressvalIDAtiON) >= 0)
			{
				document.getElementById("ADD1Error").innerHTML="<br>Please Give Proper Address.";
				document.getElementById("ADD1Error").style.display='';
				document.getElementById("ADD1").ClassName="RedClass";
				document.getElementById("ADD1").focus();
				return false;
			}
			var str =Trim(document.getElementById("ADD1").value);
			if( str=='')
			{
				document.getElementById("ADD1Error").innerHTML="<br>Please Dont Give Space In Address Field.";
				document.getElementById("ADD1Error").style.display='';
				document.getElementById("ADD1").ClassName="RedClass";
				document.getElementById("ADD1").value="";
				document.getElementById("ADD1").focus();
				return false;
			}
			else
			{
				document.getElementById("ADD1Error").innerHTML="";
				document.getElementById("ADD1Error").style.display='none';
				document.getElementById("ADD1").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("ADD1Error") != null)
			{
				document.getElementById("ADD1Error").innerHTML="Please Type Your Address.";
				document.getElementById("ADD1Error").style.display='';
				document.getElementById("ADD1").ClassName="RedClass";
				document.getElementById("ADD1").focus();
				return false;
			}
		}
	}



	if(document.getElementById("ADD2") != null)
	{
		if(document.getElementById("ADD2").value != '')
		{
			if(document.getElementById("ADD2").value.search(AddressvalIDAtiON) >= 0)
			{
				document.getElementById("ADD2Error").innerHTML="<br>Please Give Proper Address.";
				document.getElementById("ADD2Error").style.display='';
				document.getElementById("ADD2").ClassName="RedClass";
				document.getElementById("ADD2").focus();
				return false;
			}
			var str =Trim(document.getElementById("ADD2").value);
			if( str=='')
			{
				document.getElementById("ADD2Error").innerHTML="<br>Please Dont Give Space In Address Field.";
				document.getElementById("ADD2Error").style.display='';
				document.getElementById("ADD2").ClassName="RedClass";
				document.getElementById("ADD2").value="";
				document.getElementById("ADD2").focus();
				return false;
			}
			else
			{
				document.getElementById("ADD2Error").innerHTML="";
				document.getElementById("ADD2Error").style.display='none';
				document.getElementById("ADD2").ClassName="NormalClass";		
			}
		}
		/*else
		{
			if(document.getElementById("ADD2Error") != null)
			{
				document.getElementById("ADD2Error").innerHTML="<br>Please Type Your Address.";
				document.getElementById("ADD2Error").style.display='';
				document.getElementById("ADD2").ClassName="RedClass";
				document.getElementById("ADD2").focus();
				return false;
			}
		}*/
	}


	if(document.getElementById("CounTrySELECT") != null && document.getElementById("COUNTRY").style.display != 'none')
	{
		//alert(document.getElementById("CounTrySELECT").value)
		if(document.getElementById("CounTrySELECT").value == '' || document.getElementById("CounTrySELECT").value == undefined)
		{
			if(document.getElementById("CounTrySELECT") != null)
			{
				document.getElementById("CounTrySELECTError").style.display='';
				document.getElementById("CounTrySELECTError").innerHTML="<br>Please Select A Country.";
				document.getElementById("CounTrySELECT").ClassName="RedClass";
				document.getElementById("CounTrySELECT").focus();
				return false;
			}
		}
		else
		{
			document.getElementById("CounTrySELECTError").innerHTML="";
			document.getElementById("CounTrySELECTError").style.display='none';
			document.getElementById("CounTrySELECT").ClassName="NormalClass";
			//document.getElementById("CounTrySELECT").focus();
		}
	}



	if(document.getElementById("CounTrySELECT1") != null && document.getElementById("COUNTRY1").style.display == '')
	{
		if(document.getElementById("CounTrySELECT1").value != '')
		{
			if(document.getElementById("CounTrySELECT1").value.search(NameVAlidation) >= 0)
			{
				document.getElementById("CounTrySELECTError").innerHTML="<br>Your Country Should Be Only Charecters.";
				document.getElementById("CounTrySELECTError").style.display='';
				document.getElementById("CounTrySELECT1").ClassName="RedClass";
				document.getElementById("CounTrySELECT1").focus();
				return false;
			}
			var str =Trim(document.getElementById("CounTrySELECT1").value);
			if( str=='')
			{
				document.getElementById("CounTrySELECTError").innerHTML="<br>Please Dont Give Space In Country Field.";
				document.getElementById("CounTrySELECTError").style.display='';
				document.getElementById("CounTrySELECT1").ClassName="RedClass";
				document.getElementById("CounTrySELECT1").value="";
				document.getElementById("CounTrySELECT1").focus();
				return false;
			}
			else
			{
				document.getElementById("CounTrySELECTError").innerHTML="";
				document.getElementById("CounTrySELECTError").style.display='none';
				document.getElementById("CounTrySELECT1").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("CounTrySELECTError") != null)
			{
				document.getElementById("CounTrySELECTError").innerHTML="<br>Please Type Your Country.";
				document.getElementById("CounTrySELECTError").style.display='';
				document.getElementById("CounTrySELECT1").ClassName="RedClass";
				document.getElementById("CounTrySELECT1").focus();
				return false;
			}
		}
	}



	if(document.getElementById("StaTeSELECT") != null && document.getElementById("STATE").style.display == '')
	{
		//alert(document.getElementById("StaTeSELECT").value)
		if(document.getElementById("StaTeSELECT").value == '' || document.getElementById("StaTeSELECT").value == undefined)
		{
			if(document.getElementById("StaTeSELECT") != null)
			{
				document.getElementById("StaTeSELECTError").innerHTML="<br>Please Select A State.";
				document.getElementById("StaTeSELECTError").style.display='';
				document.getElementById("StaTeSELECT").ClassName="RedClass";
				document.getElementById("StaTeSELECT").focus();
				return false;
			}
		}
		else
		{
			document.getElementById("StaTeSELECTError").innerHTML="";
			document.getElementById("StaTeSELECTError").style.display='none';
			document.getElementById("StaTeSELECT").ClassName="NormalClass";
			//document.getElementById("StaTeSELECT").focus();
		}
	}



	if(document.getElementById("StaTeSELECT1") != null && document.getElementById("STATE1").style.display == '')
	{
		if(document.getElementById("StaTeSELECT1").value != '')
		{
			if(document.getElementById("StaTeSELECT1").value.search(NameVAlidation) >= 0)
			{
				document.getElementById("StaTeSELECTError").innerHTML="<br>Your State Should Be Only Charecters.";
				document.getElementById("StaTeSELECTError").style.display='';
				document.getElementById("StaTeSELECT1").ClassName="RedClass";
				document.getElementById("StaTeSELECT1").focus();
				return false;
			}
			var str =Trim(document.getElementById("StaTeSELECT1").value);
			if( str=='')
			{
				document.getElementById("StaTeSELECTError").innerHTML="<br>Please Dont Give Space In State Field.";
				document.getElementById("StaTeSELECTError").style.display='';
				document.getElementById("StaTeSELECT1").ClassName="RedClass";
				document.getElementById("StaTeSELECT1").value="";
				document.getElementById("StaTeSELECT1").focus();
				return false;
			}
			else
			{
				document.getElementById("StaTeError").innerHTML="";
				document.getElementById("StaTeError").style.display='none';
				document.getElementById("StaTe1").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("StaTeError") != null)
			{
				document.getElementById("StaTeError").innerHTML="<br>Please Type Your State.";
				document.getElementById("StaTeError").style.display='';
				document.getElementById("StaTe1").ClassName="RedClass";
				document.getElementById("StaTe1").focus();
				return false;
			}
		}
	}



	if(document.getElementById("CiTySelect") != null && document.getElementById("CITY").style.display == '')
	{
		if(document.getElementById("CiTySelect").value == '' || document.getElementById("CiTySelect").value == undefined)
		{
			if(document.getElementById("CiTySelect") != null)
			{
				document.getElementById("CiTySelectError").innerHTML="<br>Please Select A City.";
				document.getElementById("CiTySelectError").style.display='';
				document.getElementById("CiTySelect").ClassName="RedClass";
				document.getElementById("CiTySelect").focus();
				return false;
			}
		}
		else
		{
			document.getElementById("CiTySelectError").innerHTML="";
			document.getElementById("CiTySelectError").style.display='none';
			document.getElementById("CiTySelect").ClassName="NormalClass";
			//document.getElementById("CiTySelect").focus();
		}
	}



	if(document.getElementById("CiTySelect1") != null && document.getElementById("CITY1").style.display == '')
	{
		if(document.getElementById("CiTySelect1").value != '')
		{
			if(document.getElementById("CiTySelect1").value.search(NameVAlidation) >= 0)
			{
				document.getElementById("CiTySelectError").innerHTML="<br>Your Country Should Be Only Charecters.";
				document.getElementById("CiTySelectError").style.display='';
				document.getElementById("CiTySelect1").ClassName="RedClass";
				document.getElementById("CiTySelect1").focus();
				return false;
			}
			var str =Trim(document.getElementById("CiTySelect1").value);
			if( str=='')
			{
				document.getElementById("CiTySelectError").innerHTML="<br>Please Dont Give Space In Country Field.";
				document.getElementById("CiTySelectError").style.display='';
				document.getElementById("CiTySelect1").ClassName="RedClass";
				document.getElementById("CiTySelect1").value="";
				document.getElementById("CiTySelect1").focus();
				return false;
			}
			else
			{
				document.getElementById("CiTySelectError").innerHTML="";
				document.getElementById("CiTySelectError").style.display='none';
				document.getElementById("CiTySelect1").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("CiTySelectError") != null)
			{
				document.getElementById("CiTySelectError").innerHTML="<br>Please Type Your Country.";
				document.getElementById("CiTySelectError").style.display='';
				document.getElementById("CiTySelect1").ClassName="RedClass";
				document.getElementById("CiTySelect1").focus();
				return false;
			}
		}
	}



	if(document.getElementById("ZIpcoDE") != null)
	{
		if(document.getElementById("ZIpcoDE").value != '')
		{
			if(document.getElementById("ZIpcoDE").value.search(ZIpVAlidation) >= 0)
			{
				document.getElementById("ZIpcoDEError").innerHTML="<br>Your Zipcode Should Be Only Charecters And Numeric.";
				document.getElementById("ZIpcoDEError").style.display='';
				document.getElementById("ZIpcoDE").ClassName="RedClass";
				document.getElementById("ZIpcoDE").focus();
				return false;
			}
			var str =Trim(document.getElementById("ZIpcoDE").value);
			if( str=='')
			{
				document.getElementById("ZIpcoDEError").innerHTML="<br>Please Dont Give Space In Zipcode Field.";
				document.getElementById("ZIpcoDEError").style.display='';
				document.getElementById("ZIpcoDE").ClassName="RedClass";
				document.getElementById("ZIpcoDE").value="";
				document.getElementById("ZIpcoDE").focus();
				return false;
			}
			else
			{
				document.getElementById("ZIpcoDEError").innerHTML="";
				document.getElementById("ZIpcoDEError").style.display='none';
				document.getElementById("ZIpcoDE").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("ZIpcoDEError") != null)
			{
				document.getElementById("ZIpcoDEError").innerHTML="<br>Please Type Your Zipcode.";
				document.getElementById("ZIpcoDEError").style.display='';
				document.getElementById("ZIpcoDE").ClassName="RedClass";
				document.getElementById("ZIpcoDE").focus();
				return false;
			}
		}
	}



	if(document.getElementById("HomePhone") != null)
	{
		if(document.getElementById("HomePhone").value != '')
		{
			if(document.getElementById("HomePhone").value.search(PhonEVAlidation) >= 0)
			{
				document.getElementById("HomePhoneError").innerHTML="<br>Invalid Phone Number.";
				document.getElementById("HomePhoneError").style.display='';
				document.getElementById("HomePhone").ClassName="RedClass";
				document.getElementById("HomePhone").focus();
				return false;
			}
			var str =Trim(document.getElementById("HomePhone").value);
			if( str=='')
			{
				document.getElementById("HomePhoneError").innerHTML="<br>Please Dont Give Space In Home Phone Field.";
				document.getElementById("HomePhoneError").style.display='';
				document.getElementById("HomePhone").ClassName="RedClass";
				document.getElementById("HomePhone").value="";
				document.getElementById("HomePhone").focus();
				return false;
			}
			else
			{
				document.getElementById("HomePhoneError").innerHTML="";
				document.getElementById("HomePhoneError").style.display='none';
				document.getElementById("HomePhone").ClassName="NormalClass";		
			}
		}
		/*else
		{
			if(document.getElementById("HomePhoneError") != null)
			{
				document.getElementById("HomePhoneError").innerHTML="<br>Please Type Your User Name.";
				document.getElementById("HomePhoneError").style.display='';
				document.getElementById("HomePhone").ClassName="RedClass";
				document.getElementById("HomePhone").focus();
				return false;
			}
		}*/
	}



	if(document.getElementById("MOBIle") != null)
	{
		if(document.getElementById("MOBIle").value != '')
		{
			if(document.getElementById("MOBIle").value.search(PhonEVAlidation) >= 0)
			{
				document.getElementById("MOBIleError").innerHTML="<br>Invalid Cell Phone Number.";
				document.getElementById("MOBIleError").style.display='';
				document.getElementById("MOBIle").ClassName="RedClass";
				document.getElementById("MOBIle").focus();
				return false;
			}
			var str =Trim(document.getElementById("MOBIle").value);
			if( str=='')
			{
				document.getElementById("MOBIleError").innerHTML="<br>Please Dont Give Space In Mobile Phone Field.";
				document.getElementById("MOBIleError").style.display='';
				document.getElementById("MOBIle").ClassName="RedClass";
				document.getElementById("MOBIle").value="";
				document.getElementById("MOBIle").focus();
				return false;
			}
			else
			{
				document.getElementById("MOBIleError").innerHTML="";
				document.getElementById("MOBIleError").style.display='none';
				document.getElementById("MOBIle").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("MOBIleError") != null)
			{
				document.getElementById("MOBIleError").innerHTML="<br>Please Type Your Mobile Phone Number.";
				document.getElementById("MOBIleError").style.display='';
				document.getElementById("MOBIle").ClassName="RedClass";
				document.getElementById("MOBIle").focus();
				return false;
			}
		}
	}

	//alert(document.getElementById("Picker1"));
	//alert(document.getElementById("Picker1").value)

	//if(document.getElementById("Picker1") != null && document.getElementById("Picker1").value == 'N' )
	//{
		//alert(document.getElementById("Picker").value)

	if(document.getElementById("SecuRityQUEstiOnDRop") != null)
	{
		if(document.getElementById("SecuRityQUEstiOnDRop").value != '')
		{
			if(document.getElementById("SecuRityQUEstiOnDRop").value == 0)
			{
				//document.getElementById("PUblishNameText").disabled=false;
				//document.getElementById("PUblishNameText").style.display='';
				RETURnvalUE=SECURITYquestionValidation();
				if(RETURnvalUE == false)
				{
					return RETURnvalUE;
				}
				
			}
			else
			{
				//document.getElementById("PUblishNameText").disabled=true;
				//document.getElementById("PUblishNameText").style.display='none';
				document.getElementById("SecuRityQUEstiOn").value=document.getElementById("SecuRityQUEstiOnDRop").value;
				//RETURnvalUE=true;
				
				document.getElementById("SecuRityQUEstiOnError").innerHTML="";
				document.getElementById("SecuRityQUEstiOnError").style.display='none';
				document.getElementById("SecuRityQUEstiOnDRop").ClassName="NormalClass";		
			}
			
		}
		else
		{
			if(document.getElementById("SecuRityQUEstiOnError") != null)
			{
				document.getElementById("SecuRityQUEstiOnError").innerHTML="<br>Please Select Your Security Question.";
				document.getElementById("SecuRityQUEstiOnError").style.display='';
				document.getElementById("SecuRityQUEstiOnDRop").ClassName="RedClass";
				document.getElementById("SecuRityQUEstiOnDRop").focus();
				return false;
			}
		}
	}
	
	if(document.getElementById("SEcuRItyANSwer") != null)
	{
		

		if(document.getElementById("SEcuRItyANSwer").value != '')
		{
			var str =Trim(document.getElementById("SEcuRItyANSwer").value);
			if( str=='')
			{
				document.getElementById("SEcuRItyANSwerError").innerHTML="<br>Please Dont Give Space In Answer Field.";
				document.getElementById("SEcuRItyANSwerError").style.display='';
				document.getElementById("SEcuRItyANSwer").ClassName="RedClass";
				document.getElementById("SEcuRItyANSwer").value="";
				document.getElementById("SEcuRItyANSwer").focus();
				return false;
			}
			else
			{
				document.getElementById("SEcuRItyANSwerError").innerHTML="";
				document.getElementById("SEcuRItyANSwerError").style.display='none';
				document.getElementById("SEcuRItyANSwer").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("SEcuRItyANSwerError") != null)
			{
				document.getElementById("SEcuRItyANSwerError").innerHTML="<br>Please Type Your Answer Respective For The Question.";
				document.getElementById("SEcuRItyANSwerError").style.display='';
				document.getElementById("SEcuRItyANSwer").ClassName="RedClass";
				document.getElementById("SEcuRItyANSwer").focus();
				return false;
			}
		}
	}

	if(document.getElementById("ChoosePlan") != null)
	{
		if(document.getElementById("ChoosePlan").value == '')
		{
			if(document.getElementById("ChoosePlan") != null)
			{
				document.getElementById("ChoosePlanError").innerHTML="<br>Please Select A Plan.";
				document.getElementById("ChoosePlanError").style.display='';
				document.getElementById("ChoosePlan").ClassName="RedClass";
				document.getElementById("ChoosePlan").focus();
				return false;
			}
		}
		else
		{
			document.getElementById("ChoosePlanError").innerHTML="";
			document.getElementById("ChoosePlanError").style.display='none';
			document.getElementById("ChoosePlan").ClassName="NormalClass";
			RETURnvalUE=true;
			//document.getElementById("ChoosePlan").focus();
		}
		//alert(RETURnvalUE);
	}

	
	return RETURnvalUE;
		
	//}
	/*if(document.getElementById("FirstName") != null)
	{
		if(document.getElementById("FirstName").value != '')
		{
			if(document.getElementById("FirstName").value.search() >= 0)
			{
				document.getElementById("FirstNameError").innerHTML="<br>Your First Name Should Be Only Charecters.";
				document.getElementById("FirstNameError").style.display='';
				document.getElementById("FirstName").ClassName="RedClass";
				document.getElementById("FirstName").focus();
				return false;
			}
			var str =Trim(document.getElementById("FirstName").value);
			if( str=='')
			{
				document.getElementById("FirstNameError").innerHTML="<br>Please Dont Give Space In First Name Field.";
				document.getElementById("FirstNameError").style.display='';
				document.getElementById("FirstName").ClassName="RedClass";
				document.getElementById("FirstName").value="";
				document.getElementById("FirstName").focus();
				return false;
			}
			else
			{
				document.getElementById("FirstNameError").innerHTML="";
				document.getElementById("FirstNameError").style.display='none';
				document.getElementById("FirstName").ClassName="NormalClass";		
			}
		}
		else
		{
			if(document.getElementById("FirstNameError") != null)
			{
				document.getElementById("FirstNameError").innerHTML="<br>Please Type Your User Name.";
				document.getElementById("FirstNameError").style.display='';
				document.getElementById("FirstName").ClassName="RedClass";
				document.getElementById("FirstName").focus();
				return false;
			}
		}
	}*/


}

function SECURITYquestionValidation()
{
	if(document.getElementById("SecuRityQUEstiOnTExt") != null)
	{
		if(document.getElementById("SecuRityQUEstiOnTExt").value != '')
		{
			if(document.getElementById("SecuRityQUEstiOnTExt").value.length < 5)
			{
			document.getElementById("SecuRityQUEstiOnError").innerHTML="<br>Please Type Your Security Question Grater Then 5 charecters.";
				document.getElementById("SecuRityQUEstiOnError").style.display='';
				document.getElementById("SecuRityQUEstiOnTExt").ClassName="RedClass";
				document.getElementById("SecuRityQUEstiOnTExt").focus();
				return false;
			}
			var str =Trim(document.getElementById("SecuRityQUEstiOnTExt").value);
			if( str=='')
			{
				document.getElementById("SecuRityQUEstiOnError").innerHTML="<br>Please Dont Give Space In Security Question Field.";
				document.getElementById("SecuRityQUEstiOnError").style.display='';
				document.getElementById("SecuRityQUEstiOnTExt").ClassName="RedClass";
				document.getElementById("SecuRityQUEstiOnTExt").value="";
				document.getElementById("SecuRityQUEstiOnTExt").focus();
				return false;
			}
			else
			{
				document.getElementById("SecuRityQUEstiOnError").innerHTML="";
				document.getElementById("SecuRityQUEstiOnError").style.display='none';
				document.getElementById("SecuRityQUEstiOnTExt").ClassName="NormalClass";
				document.getElementById("SecuRityQUEstiOn").value=document.getElementById("SecuRityQUEstiOnTExt").value;
				return true;	
			}
		}
		else
		{
			if(document.getElementById("SecuRityQUEstiOnError") != null)
			{
				document.getElementById("SecuRityQUEstiOnError").innerHTML="<br>Please Type Your Security Question.";
				document.getElementById("SecuRityQUEstiOnError").style.display='';
				document.getElementById("SecuRityQUEstiOnTExt").ClassName="RedClass";
				document.getElementById("SecuRityQUEstiOnTExt").focus();
				return false;
			}
		}
		
	}
	
}




function DISPLAYtextbox(ARgumeNT,DISPLAYID)
{
	if(ARgumeNT == 0 && ARgumeNT != '' )
	{
		if(document.getElementById(DISPLAYID) != null)
		{
			document.getElementById(DISPLAYID).disabled = false;
			document.getElementById(DISPLAYID).style.display = '';
		}
	}
	else //if(ARgumeNT == '')
	{
		if(document.getElementById(DISPLAYID) != null)
		{
			document.getElementById(DISPLAYID).disabled = true;
			document.getElementById(DISPLAYID).style.display = 'none';
		}
	}
	
}

/*************************************** VALIDATION ENDS HERE **********************************************/

/*************************************** REDIRECTION STARTS FROM HERE **********************************************/

function redireCTION(ReDIRectIONurl)
{
	window.location=ReDIRectIONurl;
}

/*************************************** REDIRECTION ENDS HERE **********************************************/


/*************************************** PASSWORD CHECK STARTS FROM HERE **********************************************/

function CHECKpassword(password1,password2)
{
	if(document.getElementById(password1) != null)
	{
		if(document.getElementById(password1).value != '')
		{
			if(document.getElementById(password1).value.length < 6)
			{
				document.getElementById(password1+"Error").innerHTML="<br>Please Type Your Password Grater Then 6 charecters.";
				document.getElementById(password1+"Error").style.display='';
				document.getElementById(password1).ClassName="RedClass";
				document.getElementById(password1).focus();
				return false;
			}
			var str =Trim(document.getElementById("UserName").value);
			if( str=='')
			{
				document.getElementById(password1+"Error").innerHTML="<br>Please Dont Give Space In Password Field.";
				document.getElementById(password1+"Error").style.display='';
				document.getElementById(password1).ClassName="RedClass";
				document.getElementById(password1).value="";
				document.getElementById(password1).focus();
				return false;
			}
		}
		else
		{
			document.getElementById(password1+"Error").innerHTML="<br>Please Type Your Password.";
			document.getElementById(password1+"Error").style.display='';
			document.getElementById(password1).ClassName="RedClass";
			document.getElementById(password1).focus();
			return false;
		}
	}
	if(document.getElementById(password2) != null)
	{
		if(document.getElementById(password2).value != '')
		{
			if( document.getElementById(password2).value != document.getElementById(password1).value )
			{
				document.getElementById(password2+"Error").innerHTML="<br>Password Mismatch.";
				document.getElementById(password2+"Error").style.display='';
				document.getElementById(password2).ClassName="RedClass";
				document.getElementById(password2).value="";
				document.getElementById(password2).focus();
				return false;
			}
		}
		else
		{
			document.getElementById(password2+"Error").innerHTML="<br>Please Retype Your Password.";
			document.getElementById(password2+"Error").style.display='';
			document.getElementById(password2).ClassName="RedClass";
			document.getElementById(password2).focus();
			return false;
		}
	}
}

/*************************************** PASSWORD CHECK ENDS HERE **********************************************/